package ru.sstu.renju.config;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import java.util.ResourceBundle;

import ru.sstu.renju.core.Player;
import ru.sstu.renju.ui.GameRenderer;

/**
 * {@code Config} class just holds game configuration settings.
 *
 * @author denis_murashev
 * @since Renju 1.0
 */
public class Config implements Serializable {

	private static final long serialVersionUID = 805692015472466562L;

	private final ResourceBundle bundle = ResourceBundle.getBundle("messages");
	private int gameSize;
	private int rowSize;
	private long moveDelay;
	private List<Player> players;
	private Player blackPlayer;
	private Player whitePlayer;
	private int cellSize;
	private List<GameRenderer> renderers;
	private GameRenderer renderer;

	/**
	 * @return the bundle
	 * @since Renju 1.1
	 */
	public ResourceBundle getBundle() {
		return bundle;
	}

	/**
	 * @return the game size
	 * @since Renju 1.1
	 */
	public int getGameSize() {
		return gameSize;
	}

	/**
	 * @param gameSize the game size to set
	 * @since Renju 1.1
	 */
	protected void setGameSize(int gameSize) {
		this.gameSize = gameSize;
	}

	/**
	 * @return the rowSize
	 * @since Renju 1.1
	 */
	public int getRowSize() {
		return rowSize;
	}

	/**
	 * @param rowSize the rowSize to set
	 * @since Renju 1.1
	 */
	protected void setRowSize(int rowSize) {
		this.rowSize = rowSize;
	}

	/**
	 * @return the moveDelay
	 */
	public long getMoveDelay() {
		return moveDelay;
	}

	/**
	 * @param moveDelay the moveDelay to set
	 */
	public void setMoveDelay(long moveDelay) {
		this.moveDelay = moveDelay;
	}

	/**
	 * @return the players
	 * @since Renju 1.1
	 */
	public List<Player> getPlayers() {
		return players;
	}

	/**
	 * @param players the players to set
	 * @since Renju 1.1
	 */
	protected void setPlayers(List<Player> players) {
		this.players = Collections.unmodifiableList(players);
	}

	/**
	 * @return the blackPlayer
	 */
	public Player getBlackPlayer() {
		return blackPlayer;
	}

	/**
	 * @param blackPlayer the blackPlayer to set
	 */
	public void setBlackPlayer(Player blackPlayer) {
		this.blackPlayer = blackPlayer;
	}

	/**
	 * @return the whitePlayer
	 */
	public Player getWhitePlayer() {
		return whitePlayer;
	}

	/**
	 * @param whitePlayer the whitePlayer to set
	 */
	public void setWhitePlayer(Player whitePlayer) {
		this.whitePlayer = whitePlayer;
	}

	/**
	 * @return the cellSize
	 * @since Renju 1.1
	 */
	public int getCellSize() {
		return cellSize;
	}

	/**
	 * @param cellSize the cellSize to set
	 * @since Renju 1.1
	 */
	protected void setCellSize(int cellSize) {
		this.cellSize = cellSize;
	}

	/**
	 * @return the renderers
	 * @since Renju 1.1
	 */
	public List<GameRenderer> getRenderers() {
		return renderers;
	}

	/**
	 * @param renderers the renderers to set
	 * @since Renju 1.1
	 */
	protected void setRenderers(List<GameRenderer> renderers) {
		this.renderers = Collections.unmodifiableList(renderers);
	}

	/**
	 * @return the renderer
	 */
	public GameRenderer getRenderer() {
		return renderer;
	}

	/**
	 * @param renderer the renderer to set
	 */
	public void setRenderer(GameRenderer renderer) {
		this.renderer = renderer;
	}
}
